package ar.com.spsolutions.splibrary.author;

import ar.com.spsolutions.splibrary.book.Book;

public class AuthorBuilder {

	private transient Author toBuild;

	public static Author createInstanceForTest() {
		return new AuthorBuilder()//
				.withName("Nombre del actor")//
				.build();
	}

	public AuthorBuilder() {
		this.toBuild = new Author();
	}

	public AuthorBuilder withName(final String aName) {
		this.getToBuild().setName(aName);

		return this;
	}

	public AuthorBuilder addBook(final Book book) {
		this.getToBuild().addBook(book);
		return this;
	}

	public Author build() {
		return this.getToBuild();
	}

	private Author getToBuild() {
		return this.toBuild;
	}

}
